package com.tchy.cloud.entity;

import javax.persistence.*;
import java.util.Date;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * xmweilove
 * 用户量表id
 */
@Entity
@Table(name = "c_consumer_ques", schema = "", catalog = "")
public class CConsumerQuesEntity {
    private Integer id;//主键 consumer_ques_id
    private ACustomerEntity customerEntity;// 用户id  consumer_id
    private CQuestionnaireEntity questEntity;//量表id  questionnaire_id
    private Integer submitTime;//提交量表时间戳  submit_time
    private Date createTime;//创建时间 create_time


    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "consumer_ques_id")
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @OneToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "consumer_id")
    public ACustomerEntity getCustomerEntity() {
        return customerEntity;
    }

    public void setCustomerEntity(ACustomerEntity customerEntity) {
        this.customerEntity = customerEntity;
    }


    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "questionnaire_id")
    public CQuestionnaireEntity getQuestEntity() {
        return questEntity;
    }

    public void setQuestEntity(CQuestionnaireEntity questEntity) {
        this.questEntity = questEntity;
    }


    @Basic
    @Column(name = "submit_time")
    public Integer getSubmitTime() {
        return submitTime;
    }

    public void setSubmitTime(Integer submitTime) {
        this.submitTime = submitTime;
    }

    @Basic
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
}
